"""
Author: yangyuqi yangyuqi@datagrand.com
Date: 2024-12-16 10:53:43
LastEditors: yangyuqi yangyuqi@datagrand.com
LastEditTime: 2024-12-24 14:06:43
FilePath: /simple-util-py/simpleutil/randoms/__init__.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
"""

import random
import string


def generate_string(length=5, ascii_lowercase=True, ascii_case=True, numbers=True):
    characters = ""
    if ascii_lowercase:
        characters += string.ascii_lowercase
    if ascii_case:
        characters += string.ascii_uppercase
    if numbers:
        characters += string.digits
    random_string = "".join(random.choice(characters) for _ in range(length))
    return random_string
